let zz = {
  watch: {},
  methods: {

    zhengzhou_t() {


      this._earth.camera.flyAround(
        [
          1.9831997574056408,
          0.6061018071588495,
          0
        ],
        10000,
        [(360.0 * Math.PI) / 180, (-22 * Math.PI) / 180, 0],
        0.4,
        0.1
      );



      let _this = this;
      var viewer = this._earth.czm.viewer;
      let geos = [
        "zhengzhou-model-0-yes.json",
        "zhengzhou-model-0-no.json",
        "zhengzhou-model-1-yes.json",
        "zhengzhou-model-1-no.json"
      ];

      let gongrecolor = {
        "zhengzhou-model-0-yes.json": [0.65, 0.56, 0.92],
        "zhengzhou-model-0-no.json": [0.7, 0.7, 0.7],
        "zhengzhou-model-1-no.json": [0.7, 0.7, 0.7],
        "zhengzhou-model-1-yes.json": [0.02, 0.93, 0.92],
      }


      let aaa = {
        "position": [
          1.9831997574056408,
          0.6061018071588495,
          0
        ],
        scale: 30,
        name: '郑州热力'
      }

      _this.mark(aaa)

      geos.map(item => {
        var promise = Cesium.GeoJsonDataSource.load("http://124.70.158.145:9997/zz/" + item);
        let tmp_color = item
        promise.then(function (dataSource) {
          viewer.dataSources.add(dataSource);
          _this.ds.push(dataSource._name);
          var entities = dataSource.entities.values;


          var busLines = [];
          var busLines1 = [];

          for (var o = 0; o < entities.length; o++) {
            var entity = entities[o];

            //删除默认提示框
            entity.billboard = undefined;
            //判断点
            if (entity.id.split(".")[0] == 'heatplant') {
              //特殊点
              //热源厂 需要区分隔压站 锅炉房 热源
              let ln = Cesium.Cartographic.fromCartesian(
                entity.position._value
              );
              let aaa = {
                position: [ln.longitude, ln.latitude, 0],
                scale: 10,
                marklabel: true,
              }
              _this.mark(aaa)


              var routePaths = [];
              var timeDuration = 10.0;
              var moveBaseDuration = 4.0;
              routePaths.push({
                startPos: aaa.position,
                endPos: [
                  1.9831997574056408,
                  0.6061018071588495,
                  0
                ],
                width: 2.0,
                color: [
                  0.8 * Math.random() + 0.2,
                  0.5 * Math.random() + 0.5,
                  0.1,
                  5.0
                ],
                startTime: 0,
                duration: moveBaseDuration + 1.0 * Math.random()
              });
              _this.odlines(routePaths);

            } else if (entity.id.split(".")[0] == 'substation' || entity.id.split(".")[0] == 'tee') {
              //普通点
              //热力站
              if (entity.properties.name._value != "") {
                if (
                  entity.properties.name._value.indexOf("T") == -1 &&
                  entity.properties.name._value.indexOf("V") == -1
                ) {
                  // entity.point = undefined;
                  let ln = Cesium.Cartographic.fromCartesian(
                    entity.position._value
                  );

                  var points = [];
                  points.push([ln.longitude, ln.latitude, 0]);
                  points.push([
                    ln.longitude,
                    ln.latitude,
                    _.random(100, 300)
                  ]);
                  let linewidth = 2.0;
                  var timeDuration = 10;
                  var moveBaseDuration = 10;
                  busLines.push({
                    positions: points,
                    color: [
                      // gongrecolor[tmp_color][0] + 0.5 * Math.random(),
                      // gongrecolor[tmp_color][1] + 0.5 * Math.random(),
                      // gongrecolor[tmp_color][2] + 0.5 * Math.random(),
                      // 0.5
                      0.02, 0.93, 0.92,
                      10
                    ],
                    width: linewidth,
                    // startTime: timeDuration,
                    // duration: moveBaseDuration
                    translucentPass: false,
                    startTime: timeDuration * Math.random(),
                    duration: moveBaseDuration + 1.0 * Math.random()
                  });
                }
              }

            } else if (entity.id.split(".")[0] == 'pipeline') {

              let positions = []
              if (entity.polyline && entity.polyline.positions && entity.polyline.positions._value && entity.polyline.positions._value.length) {
                for (let index = 0; index < entity.polyline.positions._value.length; index++) {
                  let aaa = Cesium.Cartographic.fromCartesian(entity.polyline.positions._value[index])
                  aaa.height = _.random(80, 80)
                  var ellipsoid = _this._viewer.scene.globe.ellipsoid;
                  var cartesian3 = ellipsoid.cartographicToCartesian(aaa);
                  positions.push(cartesian3)
                }
                entity.polyline.positions._value = positions
              
                entity.polyline.width = 20; //添加默认样式
                entity.polyline.material = new Cesium.PolylineGlowMaterialProperty({
                  glowPower: .2, //一个数字属性，指定发光强度，占总线宽的百分比。
                  color: Cesium.Color.fromCssColorString('#5555')
                })
              }


            }
          }
          _this.addodlines(
            busLines,
            10,
            // [(Math.random() * 0.5 + 0.5) * 1,
            //       (Math.random() * 0.8 + 0.2) * 1,
            //       0.0,
            //       10],
            [0.02, 0.93, 0.92, 5],
            // [...gongrecolor[tmp_color], 5],
            // [0,0,0,0],
            item
          );
        });
      })

    }
  }
};

export default zz;
